package com.johnny.xia.game.mulity;

import java.io.Serializable;

public class Probability implements Serializable,Comparable<Probability>{

    /**
     * 
     */
    private static final long serialVersionUID = -5085366839850562849L;

    private int card;

    private int multiple;

    //0，全盘
    private int lineNum;
    

    public Probability(int card, int multiple, int lineNum){
        super();
        this.card = card;
        this.multiple = multiple;
        this.lineNum = lineNum;
    }
    
    

    public int getCard(){
        return card;
    }

    public int getMultiple(){
        return multiple;
    }

    public int getLineNum(){
        return lineNum;
    }

    public void setCard(int card){
        this.card = card;
    }

    public void setMultiple(int multiple){
        this.multiple = multiple;
    }

    public void setLineNum(int lineNum){
        this.lineNum = lineNum;
    }

    @Override
    public int hashCode(){
        final int prime = 31;
        int result = 1;
        result = prime * result + card;
        result = prime * result + lineNum;
        return result;
    }

    @Override
    public boolean equals(Object obj){
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Probability other = (Probability) obj;
        if (card != other.card)
            return false;
        if (lineNum != other.lineNum)
            return false;
        return true;
    }



    @Override
    public String toString(){
        return "Probability [card=" + card + ", multiple=" + multiple + ", lineNum=" + lineNum + "]";
    }



    @Override
    public int compareTo(Probability o){
        if(o.getMultiple() != this.getMultiple()){
            return this.getMultiple()+o.getMultiple();
        }
        
        return this.lineNum-o.getLineNum();
    }

}
